﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Qianli.DirSir.Model;
using Qianli.DirSir.BLL;

namespace 千里马后台
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“Service1”。
    // 注意: 为了启动 WCF 测试客户端以测试此服务，请在解决方案资源管理器中选择 Service1.svc 或 Service1.svc.cs，然后开始调试。
    public class Service1 : IService1
    {
        UserBLL ubll = new UserBLL();
        GoodsBLL gbll = new GoodsBLL();
        DHLUPSFEDEXEMSInfoBLL dBLL = new DHLUPSFEDEXEMSInfoBLL();
        StorehouseInfoBLL Shibll = new StorehouseInfoBLL();
        CustomersInfoBLL cBLL = new CustomersInfoBLL();

        ProviderInfoBLL Probll = new ProviderInfoBLL();

        StockOrderInfoBLL obll = new StockOrderInfoBLL();

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="u"></param>
        /// <returns></returns>
        public int Login(Userinfo u)
        {
            return ubll.Login(u);
        }
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="u"></param>
        /// <returns></returns>
        public int Register(Userinfo u)
        {
            return ubll.Register(u);
        }
        /// <summary>
        /// 显示商品信息
        /// </summary>
        /// <returns></returns>
        public List<GoodsInfo> Goodshow()
        {
            return gbll.Goodshow();
        }

        /// <summary>
        /// 显示商品分类
        /// </summary>
        /// <returns></returns>
        public List<GoodsTypeInfo> showGoodsType()
        {
            return gbll.showGoodsType();
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="ss"></param>
        /// <returns></returns>
        public int addGoods(GoodsInfo ss)
        {
            return gbll.addGoods(ss);
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int deleteGoods(int id)
        {
            return gbll.deleteGoods(id);
        }

        /// <summary>
        ///获取快递公司信息
        /// </summary>
        /// <returns></returns>
        public List<DHLUPSFEDEXEMSInfo> GetDHLUPSFEDEXEMSInfo()
        {
            return dBLL.GetDHLUPSFEDEXEMSInfo();
        }
        /// <summary>
        /// 显示用户信息
        /// </summary>
        /// <returns></returns>
        public List<CustomersInfo> ShowCustomersInfo()
        {
            return cBLL.ShowCustomersInfo();
        }
        /// <summary>
        /// 添加用户信息
        /// </summary>
        /// <param name="cust"></param>
        /// <returns></returns>
        public int AddCustomersInfo(CustomersInfo cust)
        {
            return cBLL.AddCustomersInfo(cust);
        }
        /// <summary>
        /// 删除用户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DelCustomersInfo(int id)
        {
            return cBLL.DelCustomersInfo(id);
        }
        /// <summary>
        /// 根据姓名搜索客户信息
        /// </summary>
        /// <param name="CustomersName"></param>
        /// <returns></returns>
        public List<CustomersInfo> GetCustomersInfoByCustomersName(string CustomersName)
        {
            return cBLL.GetCustomersInfoByCustomersName(CustomersName);
        }


        /// <summary>
        /// 显示城市信息
        /// </summary>
        /// <returns></returns>
        public List<CityInfo> ShowCity()
        {
            return cBLL.ShowCity();
        }

        #region  仓库类
        /// <summary>
        /// 显示仓库信息
        /// </summary>
        /// <returns></returns>
        public List<StorehouseInfo> Storehouseshow()
        {
            return Shibll.Storehouseshow();
        }
        /// <summary>
        /// 添加仓库
        /// </summary>
        /// <param name="Shinfo"></param>
        /// <returns></returns>
        public int StorehouseAdd(StorehouseInfo Shinfo)
        {
            return Shibll.StorehouseAdd(Shinfo);
        }
        /// <summary>
        /// 根据id获取仓库信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public StorehouseInfo StorehouseGetID(int id)
        {
            return Shibll.StorehouseGetID(id);
        }
        /// <summary>
        /// 修改仓库信息
        /// </summary>
        /// <param name="Shinfo"></param>
        /// <returns></returns>
        public int StorehouseUpdate(StorehouseInfo Shinfo)
        {
            return Shibll.StorehouseUpdate(Shinfo);
        }
        /// <summary>
        /// 根据id删除仓库
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int StorehouseDelete(int id)
        {
            return Shibll.StorehouseDelete(id);
        }
        /// <summary>
        /// 按条件搜索显示
        /// </summary>
        /// <param name="SthName"></param>
        /// <returns></returns>
        public List<StorehouseInfo> StorehouseInfoSelect(string SthName, string Sthcoding)
        {
            return Shibll.StorehouseInfoSelect(SthName,Sthcoding);
        } 
        #endregion


        /// <summary>
        ///根据id获取客户信息
        /// </summary>
        /// <returns></returns>
        public CustomersInfo GetCustomersInfoByid(int id)
        {
            return cBLL.GetCustomersInfoByid(id);
        }
        /// <summary>
        ///修改客户信息
        /// </summary>
        /// <returns></returns>
        public int UptCustomersInfo(CustomersInfo cust)
        {
            return cBLL.UptCustomersInfo(cust);
        }


        /// <summary>
        /// 添加快递公司信息
        /// </summary>
        /// <param name="dh"></param>
        /// <returns></returns>
        public int AddDHLUPSFEDEXEMSInfo(DHLUPSFEDEXEMSInfo dh)
        {
            return dBLL.AddDHLUPSFEDEXEMSInfo(dh);
        }

        /// <summary>
        /// 根据快递编号删除快递公司
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DelDHLUPSFEDEXEMSInfo(int id)
        {
            return dBLL.DelDHLUPSFEDEXEMSInfo(id);
        }
        /// <summary>
        /// 根据id搜索快递表信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DHLUPSFEDEXEMSInfo getDHLUPSFEDEXEMSInfoByid(int id)
        {
            return dBLL.getDHLUPSFEDEXEMSInfoByid(id);
        }
        /// <summary>
        /// 修改快递表信息
        /// </summary>
        /// <param name="dh"></param>
        /// <returns></returns>
        public int UptDHLUPSFEDEXEMSInfo(DHLUPSFEDEXEMSInfo dh)
        {
            return dBLL.UptDHLUPSFEDEXEMSInfo(dh);
        }
        /// <summary>
        /// 根据姓名查询
        /// </summary>
        /// <param name="DHLUPSFEDEXEMSName"></param>
        /// <returns></returns>
        public List<DHLUPSFEDEXEMSInfo> SearchDHLUPSFEDEXEMSInfo(string DHLUPSFEDEXEMSName)
        {
            return dBLL.SearchDHLUPSFEDEXEMSInfo(DHLUPSFEDEXEMSName);
        }

        #region 供应商类
        /// <summary>
        /// 供应商显示
        /// </summary>
        /// <returns></returns>
        public List<ProviderInfo> ProviderInfoShow()
        {
            return Probll.ProviderInfoShow();
        }
        /// <summary>
        /// 添加供应商
        /// </summary>
        /// <param name="Shinfo"></param>
        /// <returns></returns>
        public int ProviderInfoAdd(ProviderInfo Provd)
        {
            return Probll.ProviderInfoAdd(Provd);
        }
        /// <summary>
        /// 根据id获取数据
        /// </summary>
        /// <param name="Proid"></param>
        /// <returns></returns>
        public ProviderInfo ProviderInfoGetID(int Proid)
        {
            return Probll.ProviderInfoGetID(Proid);
        }
        /// <summary>
        /// 修改供应商信息
        /// </summary>
        /// <param name="Provd"></param>
        /// <returns></returns>
        public int ProviderInfoUpdate(ProviderInfo Provd)
        {
            return Probll.ProviderInfoUpdate(Provd);
        }
        /// <summary>
        /// 根据ID删除
        /// </summary>
        /// <param name="Proid"></param>
        /// <returns></returns>
        public int ProviderInfoDelete(int Proid)
        {
            return Probll.ProviderInfoDelete(Proid);
        }
        /// <summary>
        /// 模糊查询
        /// </summary>
        /// <param name="ProName"></param>
        /// <returns></returns>
        public List<ProviderInfo> ProviderInfoSelect(string ProName)
        {
            return Probll.ProviderInfoSelect(ProName);
        }
        #endregion


        /// <summary>
        /// 采购订单显示
        /// </summary>
        /// <returns></returns>
        public List<StockOrderInfo> StockOrderInfoShow()
        {
            return obll.StockOrderInfoShow();
        }
        /// <summary>
        /// 采购订单添加
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public List<int> AddStockOrderInfo(StockOrderInfo StockOrderInfo, List<PurchaseOrderSheetInfo> listPurchaseOrderSheetInfo)
        {
            return obll.AddStockOrderInfo(StockOrderInfo, listPurchaseOrderSheetInfo);
        }
        /// <summary>
        /// 采购订单表删除
        /// </summary>
        /// <returns></returns>
        public List<int> DelStockOrderInfo(int StockOrderID)
        {
            return obll.DelStockOrderInfo(StockOrderID);
        }
        /// <summary>
        /// 查看订单子表详细信息
        /// </summary>
        /// <param name="StockOrderID"></param>
        /// <returns></returns>
        public List<PurchaseOrderSheetInfo> GetlistPurchaseOrderSheetInfoByStockOrderID(int StockOrderID)
        {
            return obll.GetlistPurchaseOrderSheetInfoByStockOrderID(StockOrderID);
        }
        /// <summary>
        /// 获取采购订单主表信息
        /// </summary>
        /// <param name="StockOrderID"></param>
        /// <returns></returns>
        public StockOrderInfo GetStockOrderByStockOrderID(int StockOrderID)
        {
            return obll.GetStockOrderByStockOrderID(StockOrderID);
        }
        /// <summary>
        /// 修改采购订单信息
        /// </summary>
        /// <returns></returns>
        public List<int> UpdatePurchaseOrderSheetInfo(StockOrderInfo s, List<PurchaseOrderSheetInfo> listPurchaseOrderSheetInfo)
        {
            return obll.UpdatePurchaseOrderSheetInfo(s, listPurchaseOrderSheetInfo);
        }
        /// <summary>
        /// 获取供应商信息，填充到下拉列表中
        /// </summary>
        /// <returns></returns>
        public List<ProviderInfo> GetProviderInfo()
        {
            return obll.GetProviderInfo();
        }


        /// <summary>
        /// 根据id获取goods表信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public GoodsInfo GetGoodsByID(int id)
        {
            return gbll.GetGoodsByID(id);
        }
        /// <summary>
        /// 修改物品信息
        /// </summary>
        /// <param name="g"></param>
        /// <returns></returns>
        public int UptGoods(GoodsInfo g)
        {
            return gbll.UptGoods(g);
        }
        /// <summary>
        /// 根据姓名搜索物品信息
        /// </summary>
        /// <param name="GoodsName"></param>
        /// <returns></returns>
        public List<GoodsInfo> SearchGoods(string GoodsName)
        {
            return gbll.SearchGoods(GoodsName);
        }

        /// <summary>
        /// 根据采购订单模糊查询
        /// </summary>
        /// <param name="StockOrderName"></param>
        /// <returns></returns>
        public List<StockOrderInfo> GetStockOrderByStockOrderName(string DocumentsCoding)
        {
            return obll.GetStockOrderByStockOrderName(DocumentsCoding);
        }

    }
}
